package com.ficus.road.maintain.core.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author xiawen yang
 * @date 2022/3/9 下午2:25
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CarConfig {

    @JsonProperty("car_id")
    private String carId;

    @JsonProperty("camera_id")
    private Integer cameraId;

    @JsonProperty("dump")
    private boolean dump;

    @JsonProperty("image_scale")
    private double imageScale;

    @JsonProperty("output_point_cloud")
    private boolean outputPointCloud;

    @JsonProperty("output_full_gps")
    private boolean outputFullGPS;

    @JsonProperty("output_raw_picture")
    private boolean outputRawPicture;

    @JsonProperty("output_raw_sub_picture")
    private boolean outputRawSubPicture;

    @JsonProperty("output_seg_mask_picture")
    private boolean outputSegMaskPicture;

    @JsonProperty("seg_use_image")
    private boolean segUseImage;

    @JsonProperty("seg_color_map")
    private List<List<Integer>> segColorMap;

    @JsonProperty("frame_image")
    private FrameImage frameImage;

    @JsonProperty("lidar_view")
    private LidarView lidarView;

    @JsonProperty("seg_mask")
    private SegMask segMask;

    @JsonProperty("output_raw_sub_picture_index_list")
    private List<Integer> outputRawSubPictureIndexList;

    @Data
    public class FrameImage {
        @JsonProperty("_type")
        private String _type;

        @JsonProperty("encode_param")
        private EncodeParam encodeParam;

        @Data
        public class EncodeParam {
            @JsonProperty("codec_id")
            private String codecId;

            @JsonProperty("output_format")
            private String outputFormat;

            @JsonProperty("codec_name")
            private String codecName;

            @JsonProperty("pixel_format")
            private String pixelFormat;

            @JsonProperty("fps")
            private int fps;

            @JsonProperty("bitrate")
            private int bitrate;

            @JsonProperty("gop_size")
            private int gopSize;

            @JsonProperty("max_b_frames")
            private int maxBFrames;

            @JsonProperty("height")
            private int height;

            @JsonProperty("width")
            private int width;

            @JsonProperty("thread_count")
            private int threadCount;

            @JsonProperty("option")
            private Option option;

            @Data
            public class Option {

                @JsonProperty("preset")
                private String preset;

                @JsonProperty("tune")
                private String tune;
            }
        }
    }

    @Data
    public class LidarView {
        @JsonProperty("_type")
        private String _type;

        @JsonProperty("image_suffix")
        private String imageSuffix;

        @JsonProperty("image_quality")
        private int imageQuality;
    }

    @Data
    public class SegMask {
        @JsonProperty("_type")
        private String _type;
    }
}


